package com.galudisu.handsonic.modules.system.service;

import com.galudisu.handsonic.modules.system.domain.Resource;
import com.galudisu.handsonic.modules.system.domain.User;

import java.util.Collection;
import java.util.List;
import java.util.Set;

public interface ResourceService {


    Resource createResource(Resource resource);
    Resource updateResource(Resource resource);
    void deleteResource(String resourceId);

    Resource findOne(String resourceId);
    List<Resource> findAll();

    /**
     * 得到资源对应的权限字符串
     */
    Set<String> findPermissions(Set<String> resourceIds);

    /**
     * 根据用户权限得到菜单
     */
    List<Resource> findMenus(Set<String> permissions);

    List<String> findNamesByContain(Collection<String> resourceIds);

    List<Resource> findMenuListByUser(User user);
}
